package com.hkemmm.company;

public class Student extends People{
    private int grade;
    private String course;
    public int i = 1;

    public Student(int age, String sex, String name, int grade, String course) {
        super(age, sex, name);
        this.grade = grade;
        this.course = course;
    }

    //属性getter方法
    public int getGrade() {
        return grade;
    }

    public String getCourse() {
        return course;
    }

    //属性sette方法
    public void setGrade(int grade) {
        this.grade = grade;
    }

    public void setCourse(String course) {
        this.course = course;
    }

    //行为方法
    public void learn(){
        System.out.println(super.getName() + "正在学习！！");
    }

    public void exam(){
        System.out.println(super.getName() + "正在考试！！");
    }

    //通过重写父类方法实现多态
    @Override
    public void skill() {
        System.out.println(super.getName() + "学会了java！！");
    }
}
